.canvas-layout {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.canvas-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.selected-canvas-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 5px;
}

.back-button,
.save-button,
.export-button,
.clear-button {
    padding: 0 12px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    margin-right: 10px;
    margin-top: 5px;
    white-space: nowrap;
}

.back-button {
    background-color: #1890ff;
}

.back-button:hover {
    background-color: #40a9ff;
}

.save-button {
    background-color: #13c2c2;
}

.save-button:hover {
    background-color: #36cfc9;
}

.export-button {
    background-color: #4caf50;
}

.export-button:hover {
    background-color: #66bb6a;
}

.clear-button {
    background-color: #f5222d;
}

.clear-button:hover {
    background-color: #ff4d4f;
}

.save-icon, .clear-icon, .back-icon {
    font-size: 16px;
}

.left-side {
    width: 150px;
    min-width: 150px; /* 确保侧边栏不会被压缩 */
    background-color: #f0f0f0;
    border-right: 1px solid #d9d9d9;
    height: 100%;
    overflow: auto;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden; /* 防止内容溢出 */
    background-color: #ffffff;
    height: 100%; /* 确保和左侧边栏一样高 */
}

.toolbar {
    width: 250px;
    background-color: #f0f2f5;
    border-right: 1px solid #e8e8e8;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.toolbar-section {
    margin-bottom: 20px;
}

.toolbar-section h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e8e8e8;
}

.property-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.property-row label {
    width: 80px;
    font-size: 14px;
}

.property-row input[type="range"] {
    width: 100px;
}

.property-row span {
    margin-left: 5px;
    font-size: 12px;
    color: #666;
    width: 30px;
}

.property-row input[type="number"] {
    width: 60px;
}

/* 修改通用按钮样式，添加特定选择器以避免覆盖已命名的按钮 */
button:not(.back-button):not(.save-button):not(.export-button):not(.clear-button) {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:not(.back-button):not(.save-button):not(.export-button):not(.clear-button):hover {
    background-color: #40a9ff;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.current-tool-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
}

/* 浮动工具栏 */
.floating-toolbar {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 8px;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-icon {
    font-size: 16px;
}

/* 协作相关样式 */
.collaboration-alert {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 15px 20px;
  border-radius: 6px;
  text-align: center;
  z-index: 100;
}

.collaboration-alert p {
  margin: 5px 0;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 10px;
  background-color: white;
  border-bottom: 1px solid #e8e8e8;
}

/* 连接状态指示器 */
.connection-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.connection-status.connected {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}

.connection-status.disconnected {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  color: #ff4d4f;
}

/* 用户光标样式 */
.user-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
}

.user-cursor .cursor-point {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background-color: currentColor;
}

.user-cursor .cursor-name {
  position: absolute;
  left: 15px;
  top: 0;
  background-color: currentColor;
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}

/* 在线用户列表 */
.online-users {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 10px;
  z-index: 1000;
}

.online-users h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  color: #333;
}

.online-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.online-users-list li {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.user-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.user-name {
  font-size: 13px;
} 